package com.vmj.instructions.stores;

import com.vmj.heap.VMObject;
import com.vmj.rtda.Frame;

/**
 * Created by yangshoujun on 2017/8/19 上午12:29.
 */
public class StoreUtils {

    public static void lStore(Frame frame, int index) {
        Long value = frame.getOperandStack().popLong();
        frame.getLocalVars().setLong(index, value);
    }

    public static void iStore(Frame frame, int index) {
        int value = frame.getOperandStack().popInt();
        frame.getLocalVars().setInt(index, value);
    }

    public static void aStore(Frame frame, int index) {
        VMObject ref = frame.getOperandStack().popRef();
        frame.getLocalVars().setRef(index, ref);
    }
}
